]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Add `notification-removed` signal to `Source`
authorJulian Sparber <julian@sparber.net>
Wed, 14 Feb 2024 18:16:00 +0000 (19:16 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 3 Mar 2024 01:33:16 +0000 (01:33 +0000)
This allows us to drop the `destroy` signal handler for each
notification in MessageTray.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>

js/ui/messageTray.js

index 0d03e254139a462cb2459baf05a4f56921365914..a861219a4b2038cf48411d35a72ae7331b4a5d86 100644 (file)
@@ -633,6 +633,7 @@ export const Source = GObject.registerClass({
     Signals: {
         'destroy': {param_types: [GObject.TYPE_UINT]},
         'notification-added': {param_types: [Notification.$gtype]},
+        'notification-removed': {param_types: [Notification.$gtype]},
         'notification-show': {param_types: [Notification.$gtype]},
     },
 }, class Source extends MessageList.Source {
@@ -687,6 +688,7 @@ export const Source = GObject.registerClass({
             return;
 
         this.notifications.splice(index, 1);
+        this.emit('notification-removed', notification);
         this.countUpdated();
 
         if (this.notifications.length === 0)